//
// UIScrollView+SVInfiniteScrolling.h
//
// Created by Sam Vermette on 23.04.12.
// Copyright (c) 2012 samvermette.com. All rights reserved.
//
// https://github.com/samvermette/SVPullToRefresh
//
@protocol SVInfiniteScrollingViewDelegate <NSObject>
- (void)contentSizeHasChanged;
@end

#import <UIKit/UIKit.h>

@class SVInfiniteScrollingView;

@interface UIScrollView (SVInfiniteScrolling)

- (void)addInfiniteScrollingWithActionHandler:(void (^)(void))actionHandler;

@property (nonatomic, strong, readonly) SVInfiniteScrollingView *infiniteScrollingView;
@property (nonatomic, assign) BOOL showsInfiniteScrolling;

@end

enum {
	SVInfiniteScrollingStateNormal = 0, //显示加载更多字样，点击或者上拉都可触发加载更多功能
    SVInfiniteScrollingStateNoMore,  //没有更多，已全部加载完成
    SVInfiniteScrollingStateLoading, //正在加载更多...
    SVInfiniteScrollingStateFailAndHidden,   //加载失败，点击重试
    SVInfiniteScrollingStateHidden,         //隐藏自身
    SVInfiniteScrollingStateAll = 10
};

typedef NSUInteger SVInfiniteScrollingState;

@interface SVInfiniteScrollingView : UIView

@property (nonatomic, strong) UIActivityIndicatorView *activityIndicatorView;
@property (nonatomic, readwrite) UIActivityIndicatorViewStyle activityIndicatorViewStyle;
@property (nonatomic, readwrite) SVInfiniteScrollingState state;
@property (nonatomic, readwrite) BOOL enabled;
@property (nonatomic, readwrite) BOOL hasNoInfiniteScrollingView;
@property (nonatomic, assign) id<SVInfiniteScrollingViewDelegate> mydelegate;

@end
